function OrderDetail(jsonObject) {
	this.internalObject = jsonObject;
}

OrderDetail.prototype = {
	getDiscount: function() { return this.internalObject.Discount; },
	setDiscount: function(discount) { this.internalObject.Discount = discount; },
	getOrderId: function() { return this.internalObject.OrderId; },
	getProductId: function() { return this.internalObject.ProductId; },
	getQuantity: function() { return this.internalObject.Quantity; },
	setQuantity: function(quantity) { this.internalObject.Quantity = quantity; },
	getUnitPrice: function() { return this.internalObject.UnitPrice; },
	setUnitPrice: function(unitprice) { this.internalObject.UnitPrice = unitprice; },
	getCreatedDate: function() { return this.internalObject.CreatedDate; },
	getCreatedBy: function() { return this.internalObject.CreatedBy; },
	getModifiedDate: function() { return this.internalObject.ModifiedDate; },
	getModifiedBy: function() { return this.internalObject.ModifiedBy; },
	getOrderDetailObject: function() { return this.internalObject; }
};

function OrderDetailService() {
}

OrderDetailService.prototype.retrieveAll = function(successCallback) {
    viewServiceProxy.invokeGet("OrderDetailList", successCallback, OnPageError, true);
};

OrderDetailService.prototype.retrievePaged = function(successCallback, pageIndex, pageSize, sortOrder, sortColumn, linq) {
    var restUrl = "OrderDetailListPage";
    restUrl = restUrl + "/?";

    if (!IsNullOrEmpty(pageIndex)) {
        restUrl = restUrl + "pageIndex=" + pageIndex;
        if (!IsNullOrEmpty(pageSize) || !IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(pageSize)) {
        restUrl = restUrl + "pageSize=" + pageSize;
        if (!IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortOrder)) {
        restUrl = restUrl + "sortOrder=" + sortOrder;
        if (!IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortColumn)) {
        restUrl = restUrl + "sortColumn=" + sortColumn;
        if (!IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    restUrl = restUrl + "linq=" + linq;

    viewServiceProxy.invokeGet(restUrl, successCallback, OnPageError, true);
};

OrderDetailService.prototype.save = function(orderdetail, successCallback) {
viewServiceProxy.invokePut("OrderDetail", orderdetail.getOrderDetailObject(), successCallback, OnPageError, true);
};
